#include "fxcc/yml/Serializer.h"
#include "fxcc/core/audio/common/Maps.h"

using namespace YAML;
using namespace fxcc::yml;
using namespace fxcc::audio::common;


using CType = fxcc::audio::common::Source;

template<>
void Serializer::Encode<CType::Desc>(YAML::Node& node, const CType::Desc& inst)
{
	SetVariableEnum<CType::Desc::Type>(node, "m_Type", inst.m_Type);
	SetVariable<std::string>(node, "m_OggPath", inst.m_OggPath);
	SetVariable<std::string>(node, "m_WavPath", inst.m_WavPath);
}

template<>
bool Serializer::Decode<>(const YAML::Node& node, CType::Desc& inst)
{
	GetVariableEnum<CType::Desc::Type>(node, "m_Type", inst.m_Type);
	GetVariable<std::string>(node, "m_OggPath", inst.m_OggPath);
	GetVariable<std::string>(node, "m_OggPath", inst.m_OggPath);
	return true;
}

template<>
void Serializer::Encode<CType>(YAML::Node& node, const CType& inst)
{
	SetVariable<CType::Desc>(node, "m_Desc", inst.m_Desc);
}

template<>
bool Serializer::Decode<CType>(const YAML::Node& node, CType& inst)
{
	GetVariable<CType::Desc>(node, "m_Desc", inst.m_Desc);
	return true;
}
